﻿using PureMVC.Patterns;
using PureMVC.Interfaces;

public class ApplicationFacade :Facade
{
    public new static IFacade Instance
    {
        get
        {
            if (m_instance == null)
            {
                lock (m_staticSyncRoot)
                {
                    if (m_instance == null)
                    {
                        m_instance = new ApplicationFacade();
                    }
                }
            }
            return m_instance;
        }

    }

    protected override void InitializeModel()
    {
        base.InitializeModel();
        RegisterProxy(new MyProxy());
    }

    protected override void InitializeView()
    {
        base.InitializeView();
        RegisterMediator(new MyMediator());
    }

    protected override void InitializeController()
    {
        base.InitializeController();
        RegisterCommand("Cmd_StartUpApp", typeof(CmdStartUpApp));
        RegisterCommand("Cmd_AddCount", typeof(CmdAddCount));
    }
}